From: Florian Müllner Date: Tue, 10 Jun 2025 09:00:52 +0000 (+0200) Subject: tools: Add rules override for code snippets in docs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~116^2^2~31 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6aaf63b7b722acca49e1ac2b97aedc784613c025;p=gnome-shell.git tools: Add rules override for code snippets in docs The snippets don't have context, so any rules that catch undefined or unused stuff don't apply. We currently disable those rules via command-line parameters. Including it in the config instead will allow to re-use the run-eslint.sh wrapper. Part-of: --- diff --git a/tools/eslint.config.js b/tools/eslint.config.js index 82b860911..6c7c37742 100644 --- a/tools/eslint.config.js +++ b/tools/eslint.config.js @@ -77,5 +77,13 @@ export default defineConfig([ N_: 'readonly', }, }, + }, { + // doc snippets, disable rules that depend on wider context + files: ['tmp.*/*.js'], + rules: { + 'no-undef': 'off', + 'no-unused-vars': 'off', + 'no-invalid-this': 'off', + }, }, ]);